package com.sinosoft.brokerchannel.base.dao.impl;

import java.util.Map;

import com.sinosoft.brokerchannel.base.utile.BaseCacheWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.sinosoft.brokerchannel.base.dao.BasChannelSetDao;
import com.sinosoft.brokerchannel.base.bins.BasChannelSet;
import com.sinosoft.brokerchannel.base.utile.ToolUtils;


/**
 * 需求名称:非车理赔渠道平台
 * 类描述:[从缓存中查询渠道配置信息]
 * @author [shilk]
 * @date [2017年10月9日 下午6:20:06]
 * @version [v1.0]
 */
@Component
public class BasChannelSetDaoImp extends BaseCacheWorker<String, BasChannelSet>{
	/** mybatis 查询渠道配置信息 **/
	@Autowired
	private BasChannelSetDao basChannelSetDao;

	/**
	 * 需求名称: [大童保险理赔渠道平台]<br/>
	 * 功能: [根据渠道编码查询渠道信息]<br/>
	 * @author shilk
	 * @date  2017-12-13
	 * @param o-查询对象  paramMap-查询参数
	 * @return {@link BasChannelSet}
	 */
	public  BasChannelSet selectByPrimaryKey(Object o ,Map<String, Object> paramMap) {
		if (ToolUtils.isNullOrEmpty(basChannelSetDao)) {
			basChannelSetDao = (BasChannelSetDao) o;
		}
		return basChannelSetDao.selectByPrimaryKey(paramMap);
	}

	/**
	 * 功能 根据渠道代码查询渠道配置信息
	 * 创建人 chengshuren
	 * 创建时间 2017-10-10 11:03:09
	 */
	public BasChannelSet selectByCompanyCode(Object o ,Map<String, Object> paramMap) {
		BasChannelSet basChannelSet =null;
		if (ToolUtils.isNullOrEmpty(basChannelSetDao)) {
			BasChannelSetDao basChannelSetDao = (BasChannelSetDao) o;
			basChannelSet = basChannelSetDao.selectByCompanyCode(paramMap);
		}else{
			basChannelSet = basChannelSetDao.selectByCompanyCode(paramMap);
		}
		return basChannelSet;

	}
 
	/**
	 * 功能 根据渠道代码查询渠道配置信息<br/>
	 * @author chengshuren
	 * @date 2017-10-10 11:03:09
	 */
	public BasChannelSet selectChannelInterface(Object o ,Map<String, Object> paramMap) {
		BasChannelSet basChannelSet;
		if (ToolUtils.isNullOrEmpty(basChannelSetDao)) {
			BasChannelSetDao basChannelSetDao = (BasChannelSetDao) o;
			basChannelSet = basChannelSetDao.selectChannelInterface(paramMap);
		}else{
			basChannelSet = basChannelSetDao.selectChannelInterface(paramMap);
		}
		return basChannelSet;
	}

	@Override
	protected BasChannelSet queryTableByKey(String key) {
		// TODO Auto-generated method stub
		return null;
	}

	
	
}
